﻿Public Class clsProdInfo
    ''' <summary>
    ''' 查询制品信息
    ''' </summary>
    ''' <param name="prod_id">生产编号</param>
    ''' <returns>制品信息</returns>
    Friend Function selectProdInfo(prod_id As String) As DataTable
        Dim szSql As String = "SELECT  a.*,b.prod_spec_name,c.b_pgd_mes_sys_id FROM sf.b_prod_info a "
        szSql &= "left join sf.t_prod_spec b on a.prod_spec_id = b.prod_spec_id "
        szSql &= "left join sf.b_pgd_lh_details c on a.b_pgd_lh_details_sys_id = c.sys_id "
        szSql &= "WHERE a.factory_id=? and a.prod_id = ? "
        Return DBacs.ExecuteSql(szSql, -1, "TS", prod_id)
    End Function

    Public Function getProdInfoById(prod_id As String, status As String) As DataTable
        Dim szSql As String = "SELECT * FROM sf.b_prod_info WHERE factory_id=? and prod_id = ? and status = ? "
        Return DBacs.ExecuteSql(szSql, -1, "TS", prod_id, status)
    End Function

    Public Function getProdInfoById(prod_id As String) As DataTable
        Dim szSql As String = "SELECT * FROM sf.b_prod_info WHERE factory_id=? and prod_id = ? "
        Return DBacs.ExecuteSql(szSql, -1, "TS", prod_id)
    End Function

End Class
